<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<title>NATS C Client with JetStream and Streaming support: KeyValue store management</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;" >
   <div id="projectname">NATS C Client with JetStream and Streaming support
   &#160;<span id="projectnumber">3.10.0-beta</span>
   </div>
   <div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__kv_group_mgt.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">KeyValue store management<div class="ingroups"><a class="el" href="group__func_group.html">Functions</a> &raquo; <a class="el" href="group__kv_group.html">KeyValue store</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga16d4c27d8ac62bb86ba601bc40f53172" id="r_ga16d4c27d8ac62bb86ba601bc40f53172"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kv_group_mgt.html#ga16d4c27d8ac62bb86ba601bc40f53172">kvConfig_Init</a> (<a class="el" href="structkv_config.html">kvConfig</a> *cfg)</td></tr>
<tr class="memdesc:ga16d4c27d8ac62bb86ba601bc40f53172"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a KeyValue configuration structure.  <br /></td></tr>
<tr class="separator:ga16d4c27d8ac62bb86ba601bc40f53172"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc445bfe87112e56a6c73872fec6893e" id="r_gabc445bfe87112e56a6c73872fec6893e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kv_group_mgt.html#gabc445bfe87112e56a6c73872fec6893e">js_CreateKeyValue</a> (<a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> **new_kv, <a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *js, <a class="el" href="structkv_config.html">kvConfig</a> *cfg)</td></tr>
<tr class="memdesc:gabc445bfe87112e56a6c73872fec6893e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a KeyValue store with a given configuration.  <br /></td></tr>
<tr class="separator:gabc445bfe87112e56a6c73872fec6893e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54e6c109a7c633e431b3eded286e00f6" id="r_ga54e6c109a7c633e431b3eded286e00f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kv_group_mgt.html#ga54e6c109a7c633e431b3eded286e00f6">js_KeyValue</a> (<a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> **new_kv, <a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *js, const char *bucket)</td></tr>
<tr class="memdesc:ga54e6c109a7c633e431b3eded286e00f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Looks-up and binds to an existing KeyValue store.  <br /></td></tr>
<tr class="separator:ga54e6c109a7c633e431b3eded286e00f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6bc715319560bc28359679fcdcead937" id="r_ga6bc715319560bc28359679fcdcead937"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kv_group_mgt.html#ga6bc715319560bc28359679fcdcead937">js_DeleteKeyValue</a> (<a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *js, const char *bucket)</td></tr>
<tr class="memdesc:ga6bc715319560bc28359679fcdcead937"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a KeyValue store.  <br /></td></tr>
<tr class="separator:ga6bc715319560bc28359679fcdcead937"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0d6bdbfabd27af67eaeb36cec0787da" id="r_gab0d6bdbfabd27af67eaeb36cec0787da"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__kv_group_mgt.html#gab0d6bdbfabd27af67eaeb36cec0787da">kvStore_Destroy</a> (<a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> *kv)</td></tr>
<tr class="memdesc:gab0d6bdbfabd27af67eaeb36cec0787da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a KeyValue store object.  <br /></td></tr>
<tr class="separator:gab0d6bdbfabd27af67eaeb36cec0787da"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These functions allow to create, get or delete a KeyValue store. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga16d4c27d8ac62bb86ba601bc40f53172" name="ga16d4c27d8ac62bb86ba601bc40f53172"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga16d4c27d8ac62bb86ba601bc40f53172">&#9670;&#160;</a></span>kvConfig_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> kvConfig_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structkv_config.html">kvConfig</a> *&#160;</td>
          <td class="paramname"><em>cfg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Use this before setting specific <a class="el" href="structkv_config.html">kvConfig</a> options and passing it to <a class="el" href="group__kv_group_mgt.html#gabc445bfe87112e56a6c73872fec6893e" title="Creates a KeyValue store with a given configuration.">js_CreateKeyValue</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__kv_group_mgt.html#gabc445bfe87112e56a6c73872fec6893e" title="Creates a KeyValue store with a given configuration.">js_CreateKeyValue</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cfg</td><td>the pointer to the stack variable <a class="el" href="structkv_config.html">kvConfig</a> to initialize. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gabc445bfe87112e56a6c73872fec6893e" name="gabc445bfe87112e56a6c73872fec6893e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc445bfe87112e56a6c73872fec6893e">&#9670;&#160;</a></span>js_CreateKeyValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> js_CreateKeyValue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> **&#160;</td>
          <td class="paramname"><em>new_kv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *&#160;</td>
          <td class="paramname"><em>js</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structkv_config.html">kvConfig</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a KeyValue store with a given configuration.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dl class="section note"><dt>Note</dt><dd>The return <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object needs to be destroyed using <a class="el" href="group__kv_group_mgt.html#gab0d6bdbfabd27af67eaeb36cec0787da" title="Destroys a KeyValue store object.">kvStore_Destroy</a> when no longer needed to free allocated memory. This is different from deleting a KeyValue store from the server using the <a class="el" href="group__kv_group_mgt.html#ga6bc715319560bc28359679fcdcead937" title="Deletes a KeyValue store.">js_DeleteKeyValue</a> API.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_kv</td><td>the location where to store the newly created <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
    <tr><td class="paramname">js</td><td>the pointer to the <a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
    <tr><td class="paramname">cfg</td><td>the pointer to the <a class="el" href="structkv_config.html">kvConfig</a> configuration information used to create the <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga54e6c109a7c633e431b3eded286e00f6" name="ga54e6c109a7c633e431b3eded286e00f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54e6c109a7c633e431b3eded286e00f6">&#9670;&#160;</a></span>js_KeyValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> js_KeyValue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> **&#160;</td>
          <td class="paramname"><em>new_kv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *&#160;</td>
          <td class="paramname"><em>js</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>bucket</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This call is when the user wants to use an existing KeyValue store. If the store does not already exists, an error is returned.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dl class="section note"><dt>Note</dt><dd>The return <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object needs to be destroyed using <a class="el" href="group__kv_group_mgt.html#gab0d6bdbfabd27af67eaeb36cec0787da" title="Destroys a KeyValue store object.">kvStore_Destroy</a> when no longer needed to free allocated memory. This is different from deleting a KeyValue store from the server using the <a class="el" href="group__kv_group_mgt.html#ga6bc715319560bc28359679fcdcead937" title="Deletes a KeyValue store.">js_DeleteKeyValue</a> API.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_kv</td><td>the location where to store the newly created <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
    <tr><td class="paramname">js</td><td>the pointer to the <a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
    <tr><td class="paramname">bucket</td><td>the name of the bucket of the existing KeyValue store. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6bc715319560bc28359679fcdcead937" name="ga6bc715319560bc28359679fcdcead937"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6bc715319560bc28359679fcdcead937">&#9670;&#160;</a></span>js_DeleteKeyValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> js_DeleteKeyValue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> *&#160;</td>
          <td class="paramname"><em>js</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>bucket</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This will delete the KeyValue store with the <code>bucket</code> name.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">js</td><td>the pointer to the <a class="el" href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
    <tr><td class="paramname">bucket</td><td>the name of the bucket of the existing KeyValue store. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab0d6bdbfabd27af67eaeb36cec0787da" name="gab0d6bdbfabd27af67eaeb36cec0787da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab0d6bdbfabd27af67eaeb36cec0787da">&#9670;&#160;</a></span>kvStore_Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void kvStore_Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> *&#160;</td>
          <td class="paramname"><em>kv</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This will simply free memory resources in the library for this <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a>, but does not delete the KeyValue store in the server.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">kv</td><td>the pointer to the <a class="el" href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">NATS.IO Supported By Synadia Communications Inc.
    <a href="http://www.nats.io">
    </a></li>
  </ul>
</div>
</body>
</html>
